<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        html, body{
            width: 100%;
            height: 100%;
        }
        .main{
            width: 100%;
            height: 100%;
            background: gray;
            position: absolute;
            left: 0;
            top: 0;
        }
        .main .login{
            padding: 10px 20px;
            background:rgb(97, 97, 97);
            width: 200px;
            height: 200px;
            margin: 200px auto;
        }
        #btn{
            text-align: center;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <!-- 阻止冒泡案例 -->
    <div id="app">
        <button @click="isShow = true">显示模态框</button>    
        <div class="main" v-show="isShow" @click="isShow = false">          
            <div class="login" @click.stop>
                <p>用户名：<input type="text"></p>
                <p>密码：<input type="text"></p>
                <p id="btn"><input type="button" value="登录" ></p>
            </div>
        </div>
    </div>
    <script>
        let app = new Vue({
            el: "#app",
            data: {
                isShow : false
            },
            methods: {
               handleClick(){
                   console.log("do once")
               }
            }
        })
    </script>
</body>
</html>